package com.wk.springboot.retry.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * message:
 *   retry:
 *     enabled: true
 *     strategy: exponential # 可扩展其他策略
 *     max-retries: 5
 *     initial-interval: 1m   # 支持时间单位
 *     multiplier: 2
 *     max-interval: 15m
 *     jitter-factor: 0.2
 */
@ConfigurationProperties(prefix = "message.retry")
@Component
@Data
//curl -X POST http://localhost:8080/actuator/refresh 刷新配置
//@RefreshScope
public class RetryConfiguration {
    private  int maxRetries = 3;
    private long initialInterval = 60000;
    private double multiplie = 2;
    private long maxInterval = 900000;
    private double jitterFactor = 0.2;
}
